package com.cqq.auth.dao.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cqq.auth.dao.OrganizationDao;
import com.cqq.auth.dao.domain.Organization;
import com.cqq.auth.dao.mapper.OrganizationMapper;
import com.cqq.common.core.base.BaseDao;
import com.cqq.common.core.base.BaseQuery;

/**
 * <h3>组织Dao接口实现类</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
@Repository("organizationDao")
public class OrganizationDaoImpl extends BaseDao implements OrganizationDao {
	
	@Autowired
	private OrganizationMapper organizationMapper;

	
	public void add(Organization obj) {
		organizationMapper.add(obj);
	}

	
	public Integer delete(Serializable id) {
		return organizationMapper.delete(id);
	}

	
	public Integer deleteAll(Integer id) {
		return organizationMapper.deleteAll(id);
	}
	
	
	public Integer update(Organization obj) {
		return organizationMapper.update(obj);
	}

	
	public Organization queryById(Serializable id) {
		return organizationMapper.queryById(id);
	}

	
	public List<Organization> queryAll() {
		return null;
	}

	
	public List<Organization> queryPage(BaseQuery query) {
		return organizationMapper.queryPage(query);
	}

	
	public Integer queryCount(BaseQuery query) {
		return organizationMapper.queryCount(query);
	}

	
	public List<Organization> queryByIds(Integer[] ids) {
		return organizationMapper.queryByIds(ids);
	}

	
	public List<Organization> queryByParentId(Integer id) {
		return organizationMapper.queryByParentId(id);
	}

	
	public List<Organization> queryByName(String name,Integer parentId) {
		return organizationMapper.queryByName(name,parentId);
	}

	
	public List<Organization> queryByUserId(Integer userId) {
		return organizationMapper.queryByUserId(userId);
	}

	
	public Organization queryByNameAndParentId(String name,
			Integer parentId) {
		return organizationMapper.queryByNameAndParentId(name, parentId);
	}

	
	public List<Map<String, Integer>> listUserCountByParentId(Integer parentId) {
		return organizationMapper.listUserCountByParentId(parentId);
	}

	
	public List<Organization> queryChildrenOrgByName(String name,
			Integer parentId) {
		// TODO Auto-generated method stub
		return organizationMapper.queryChildrenOrgByName(name, parentId);
	}

	
	public List<Organization> queryOrgByParentId(Organization org) {
		// TODO Auto-generated method stub
		return organizationMapper.queryOrgByParentId(org);
	}

}
